package com.zuipin.vo;

import java.util.List;

import com.zuipin.entity.SysUnit;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 组织部门
 */
@ApiModel(description = "组织部门Node")
public class UnitTreeNode {
	
	private Integer				id;							// 主键 id自增长
	private String				unitName;					// 组织名称
	private String				unitNo;						// 组织编号
	private Integer				parentId;					// 上级组织编号
	private Integer				delFlag;					// 0:未删除 1:已删除
	private Integer				unitStatus;					// 状态 0:未冰结 1已冻结
	private Integer				sort;						// 排序号
	private String				remark;						// 描述/备注
	private Integer				createId;					// 操作人
	private String				createTime;					// 创建时间
	private Integer				updateId;					// 更新人
	private String				updateTime;					// 更新时间
	private String				path;						// 组织层级路径
	
	private List<UnitTreeNode>	childUnits;					// 子部门
	
	public final static Integer	ENABLE				= 0;	// 启用
	public final static Integer	DISABLE				= 1;	// 禁用
	
	public final static Integer	DEL_NO				= 0;	// 未删除
	public final static Integer	DEL_YES				= 1;	// 已删除
	public static final Integer	DEFAULT_HEAD_NODE	= 1;	// 头结点ID
	
	public UnitTreeNode() {
		// TODO Auto-generated constructor stub
	}
	
	// ID和组织名称
	public UnitTreeNode(Integer id, String unitName) {
		super();
		this.id = id;
		this.unitName = unitName;
	}
	
	public UnitTreeNode(SysUnit sysUnit) {
		if (sysUnit != null) {
			this.id = sysUnit.getId();
			this.unitName = sysUnit.getUnitName();
			this.unitNo = sysUnit.getUnitNo();
			this.unitStatus = sysUnit.getUnitStatus();
			this.parentId = sysUnit.getParentId();
			this.delFlag = sysUnit.getDelFlag();
			this.sort = sysUnit.getSort();
			this.remark = sysUnit.getRemark();
			this.createId = sysUnit.getCreateId();
			this.createTime = sysUnit.getCreateTime();
			this.updateId = sysUnit.getUpdateId();
			this.updateTime = sysUnit.getUpdateTime();
			
			this.path = sysUnit.getPath();
		}
	}
	
	@ApiModelProperty(value = "主键 id自增长")
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	@ApiModelProperty(value = "组织名称")
	public String getUnitName() {
		return unitName;
	}
	
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}
	
	@ApiModelProperty(value = "组织编号")
	public String getUnitNo() {
		return unitNo;
	}
	
	public void setUnitNo(String unitNo) {
		this.unitNo = unitNo;
	}
	
	@ApiModelProperty(value = "上级组织编号")
	public Integer getParentId() {
		return parentId;
	}
	
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}
	
	@ApiModelProperty(value = "组织层级路径")
	public String getPath() {
		return path;
	}
	
	public void setPath(String path) {
		this.path = path;
	}
	
	@ApiModelProperty(value = "0:未删除 1:已删除")
	public Integer getDelFlag() {
		return delFlag;
	}
	
	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}
	
	@ApiModelProperty(value = "状态 0:未冰结 1已冻结")
	public Integer getUnitStatus() {
		return unitStatus;
	}
	
	public void setUnitStatus(Integer unitStatus) {
		this.unitStatus = unitStatus;
	}
	
	@ApiModelProperty(value = "排序号")
	public Integer getSort() {
		return sort;
	}
	
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
	@ApiModelProperty(value = "描述/备注")
	public String getRemark() {
		return remark;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@ApiModelProperty(value = "操作人")
	public Integer getCreateId() {
		return createId;
	}
	
	public void setCreateId(Integer createId) {
		this.createId = createId;
	}
	
	@ApiModelProperty(value = "创建时间")
	public String getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	
	@ApiModelProperty(value = "更新人")
	public Integer getUpdateId() {
		return updateId;
	}
	
	public void setUpdateId(Integer updateId) {
		this.updateId = updateId;
	}
	
	@ApiModelProperty(value = "更新时间")
	public String getUpdateTime() {
		return updateTime;
	}
	
	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}
	
	@ApiModelProperty(value = "子 组织")
	public List<UnitTreeNode> getChildUnits() {
		return childUnits;
	}
	
	public void setChildUnits(List<UnitTreeNode> childUnits) {
		this.childUnits = childUnits;
	}
	
}
